﻿using LxCore;

namespace LxCore
{
    public class ConditionCenter : JsObject
    {
        public ZoneCondList ZoneConds { get; set; } = new();
        public JointCondList JointConds { get; set; } = new();

        public static int CurrentMonitor { get; set; }
        public static int CurrentGraph { get; set; }

        public BoundTypes[] SolidBoundTypes { get; } = new BoundTypes[]
        {
            BoundTypes.壁面
        };
        public BoundTypes[] FluidBoundTypes { get; } = new BoundTypes[]
        {
            BoundTypes.壁面,
            BoundTypes.速度入口,
            BoundTypes.压力出口,
            BoundTypes.对称面,
        };
        public BoundTypes[] SolidSolidJointTypes { get; } = new BoundTypes[]
        {
            BoundTypes.接触壁面,
        };
        public BoundTypes[] FluidFluidJointTypes { get; } = new BoundTypes[]
        {
            BoundTypes.内部界面,
            BoundTypes.接触壁面,
        };
        public BoundTypes[] SolidFluidJointTypes { get; } = new BoundTypes[] { BoundTypes.接触壁面, };
        public override void FromJsonKV(string key, IJsonReader jsReader)
        {
            switch (key)
            {
                case nameof(ZoneConds):jsReader.ReadList(ZoneConds, null);break;
                case nameof(JointConds):jsReader.ReadList(JointConds, null);break;
                default: base.FromJsonKV(key, jsReader);break;
            }
       
        }
        public override void ToJsonKV(IJsonWriter jsWriter)
        {
            base.ToJsonKV(jsWriter);
            jsWriter.WriteList(nameof(ZoneConds), ZoneConds);
            jsWriter.WriteList(nameof(JointConds), JointConds);
        }
        public class ZoneCondList : JsList<ZoneCond>
        {

        }
        public class JointCondList : JsList<JointCond>
        {

        }
    }
}
